﻿using Keyer.DataBase.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace Keyer.DataBase.Mapping.Sqlite
{
    public class ModuleMap : EntityTypeConfiguration<sys_module>
    {
        public ModuleMap()
        {
            // 表名
            this.ToTable("Module");

            // 主键
            this.HasKey(t => t.des);

            // 属性设置
            this.Property(t => t.des)
                .HasColumnName("name")
                .HasMaxLength(40);
            this.Property(t => t.des)
                 .HasColumnName("des")
                 .HasMaxLength(120)
                 .IsRequired();
            this.Property(t => t.imgUrl)
                .HasColumnName("imgUrl")
                .HasMaxLength(120)
                .IsRequired();

            //Base属性设置            
            this.Property(t => t.createUser)
                .HasColumnName("createUser")
                .HasMaxLength(20);
            this.Property(t => t.createTime)
                 .HasColumnName("createTime");
            this.Property(t => t.rowVersion)
                .HasColumnName("rowVersion")
                .IsRowVersion();

        }
    }
}
